home *** CD-ROM | disk | FTP | other *** search
- Path: news.production.compuserve.com!news
- From: Dave Taylor <100440.2732@CompuServe.COM>
- Newsgroups: comp.lang.c
- Subject: Re: Beginer C please help me
- Date: 22 Mar 1996 17:36:19 GMT
- Organization: -
- Message-ID: <4iuoej$lm6$1@mhade.production.compuserve.com>
- References: <DoLCFx.B7x.0.bloor@torfree.net>
-
- Sherif,
-
- In answer to your 'C' question, Change the line:
-
- n = (9/5) to n = (9.0/5.0)
-
- your version divides 2 integers ( 9 & 5 ) so the result will
- be an integer i.e. 1. When you use printf() to display your float
- with the format "1.3f" the 1 will be converted to 1.000 & then
- displayed. As a basic rule of thumb, try to avoid type mixing.
-
- Rob.
- (also at: kbyec@westminster.ac.uk)
-
- --
- Thanks Dave,
-